#ifndef REST_H
#define REST_H

#include <QWidget>
#include <QMessageBox>
#include <QTableWidget>
#include <QStandardItemModel>
#include <QSqlQuery>
#include <QSqlError>
#include <QDebug>
#include <QHBoxLayout>
#include <QPushButton>
#include <QVBoxLayout>

#include "sqloperator.h"
namespace Ui {
class rest ;
}
class rest : public QWidget
{
    Q_OBJECT

public:
    explicit rest(QWidget *parent = nullptr);
    ~rest();
    void select_gear_name(const QString &heroName);
signals:
    void showPage2();
    void showPage3();

protected:
    QPushButton *queryBtn;
    QPushButton *change;
    QPushButton *del;
    QPushButton *takeout;

private slots:
    void onQueryButtonClicked();
    void onSpareButton1Clicked();
    void updateTableData();
    void save();
    void changed();


private:
    Ui::rest *ui;
    SqlOperator * sqlOr;

    void createIndependentButtons();
    void loadTableData();

    QHash<QString, QString> m_slotGearData;
};

#endif // REST_H
